L1 = 0.0;Lu1 = 0.0;Ll1 = 0.0;
L2 = 0.0;Lu2 = 0.0;Ll2 = 0.0;
forAll(beta,cellI)
{
    Lu1 += mag(beta[cellI] - beta_exact[cellI]);
    Ll1 += mag(beta_exact[cellI]);
    Lu2 += std::pow((beta[cellI] - beta_exact[cellI]),2);
    Ll2 += std::pow((beta_exact[cellI]),2);
}
L1 = Lu1 / Ll1;
L2 = Foam::sqrt(Lu2 / Ll2);
Foam::Info << "L1: " << L1 << nl;
Foam::Info << "L2: " << L2 << nl;

std::ofstream outfile;
outfile.open("error.txt", std::ios::out | std::ios::app);
outfile << mesh.C().size() << "\t" << L1 << "\t" << L2 << std::endl;
outfile.close();